package br.com.tamagotchi.conversor;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DateUtils {

	private static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");

	public static Calendar stringToCalendar(String data) {
		Calendar c = null;
		try {
			c.setTime(getSdf().parse(data));
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return c;
	}

	public static String calendarToString(Calendar c) {
		String data = getSdf().format(c.getTime());
		return data;
	}

	public static SimpleDateFormat getSdf() {
		return sdf;
	}

}
